1. Technical Field
The present invention relates to virtualized environments. More particularly, the present invention relates to an approach for optimizing the processing of interrupts in virtualized environments.
2. Description of the Related Art
Virtual I/O (VIO) server partitions provide a mechanism for sharing physical devices across logical partitions. They provide a specialized service, and have unique computing requirements when compared to “general” logical partitions. Computation on VIO servers is largely driven by external interrupts, and minimizing the latency of processing each interrupt is a pressing concern. Service time can be reduced by increasing the amount of computing resources (processing capacity) assigned to the logical partition.
In lieu of the system administrator actually assigning more computing capacity to the partition, another existing means of doing so is to “uncap” the partition. Uncapping a partition allows each of the partition's virtual CPUs to potentially consume up to a full physical processor's worth of processing capacity. That is, if a partition has 2 virtual CPUs then, in uncapped mode, it can consume up to (and no more than) 2 physical processors' worth of computing capacity. Each logical partition requests a “guaranteed” or “entitled” processing capacity, which is a (system-administrator-configured) fraction of the total number of physical processors on the server.
There is significant merit to keeping the number of virtual CPUs of a logical partition down to the minimum required to satisfy the partition's entitled processing capacity. Fewer virtual CPUs reduce the context-switch overheads of swapping multiple virtual CPUs (vCPUs) in and out of the physical processors. Also, fewer vCPUs result in less lock contention in SMP environments. A feature known as CPU folding attempts to enforce this heuristic, by collapsing capacity into the fewest number of vCPUs. CPU folding can result in increased interrupt service latencies on uncapped partitions, because it reduces the maximum processing capacity achievable by the partition by restricting the number available free cycles that the partition can consume. For example, an uncapped partition with two vCPUs and total assigned capacity of 0.4 processors could, in the absence of CPU folding, potentially consume up to two full physical CPUs' worth of processing capacity. CPU folding might result in collapsing this partition into a single vCPU with a processing capacity of 0.4, thereby reducing its maximum potential processing capacity to 1 physical CPUs' worth. Naturally, CPU folding mechanisms have algorithms that increase or decrease the number of virtual processors employed over time. Ideally, these algorithms can be conservative, so that the number of virtual processors does not vacillate unnecessary.
A challenge of traditional CPU folding mechanisms is that they use algorithms with longer periodicity than required for interrupt processing. These two requirements (reduced interrupt service latency, and reducing the number of vCPUs) are in opposition to each other, especially in interrupt-heavy environments.